<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3//EN">
<HTML><HEAD>
		<TITLE>User's Reference - GetGlobal</TITLE>
		<META HTTP-EQUIV="keywords" CONTENT="GRAPHICS VISUALIZATION VISUAL PROGRAM DATA
MINING">
	<meta http-equiv="content-type" content="text/html;charset=ISO-8859-1">
</HEAD><BODY BGCOLOR="#FFFFFF" link="#00004b" vlink="#4b004b">
		<TABLE width=510 border=0 cellpadding=0 cellspacing=0>
			<TR>
				<TD><IMG src="../images/spacer.gif" width=80 height=1></TD>
				<TD><IMG src="../images/spacer.gif" width=49 height=1></TD>
				<TD><IMG src="../images/spacer.gif" width=24 height=1></TD>
				<TD><IMG src="../images/spacer.gif" width=100 height=1></TD>
				<TD><IMG src="../images/spacer.gif" width=3 height=1></TD>
				<TD><IMG src="../images/spacer.gif" width=127 height=1></TD>
				<TD><IMG src="../images/spacer.gif" width=6 height=1></TD>
				<TD><IMG src="../images/spacer.gif" width=50 height=1></TD>
				<TD><IMG src="../images/spacer.gif" width=71 height=1></TD>
			</TR>
			<TR>
				<TD colspan=9><IMG src="../images/flcgh_01.gif" width=510 height=24 alt="OpenDX - Documentation"></TD>
			</TR>
			<TR>
				<TD colspan=2><A href="../allguide.htm"><IMG src="../images/flcgh_02.gif" width=129 height=25 border="0" alt="Full Contents"></A></TD>
				<TD colspan=3><A href="../qikguide.htm"><IMG src="../images/flcgh_03.gif" width=127 height=25 border="0" alt="QuickStart Guide"></A></TD>
				<TD><A href="../usrguide.htm"><IMG src="../images/flcgh_04.gif" width=127 height=25 border="0" alt="User's Guide"></A></TD>
				<TD colspan=3><B><A href="../refguide.htm"><IMG src="../images/flcgh_05d.gif" width=127 height=25 border="0" alt="User's Reference"></A></B></TD>
			</TR>
			<TR>
				<TD><A href="refgu065.htm"><IMG src="../images/flcgh_06.gif" width=80 height=17 border="0" alt="Previous Page"></A></TD>
				<TD colspan=2><A href="refgu067.htm"><IMG src="../images/flcgh_07.gif" width=73 height=17 border="0" alt="Next Page"></A></TD>
				<TD><A href="../refguide.htm"><IMG src="../images/flcgh_08.gif" width=100 height=17 border="0" alt="Table of Contents"></A></TD>
				<TD colspan=3><A href="refgu009.htm"><IMG src="../images/flcgh_09.gif" width=136 height=17 border="0" alt="Partial Table of Contents"></A></TD>
				<TD><A href="refgu175.htm"><IMG src="../images/flcgh_10.gif" width=50 height=17 border="0" alt="Index"></A></TD>
				<TD><A href="../srchindx.htm"><IMG src="../images/flcgh_11.gif" width=71 height=17 border="0" alt="Search"></A></TD>
			</TR>
		</TABLE>
		<H3><A name="HDRGETGLO" ></A>GetGlobal</H3>
		<P><STRONG>Category</STRONG>
		<P>
<A HREF="refgu008.htm#HDRCATFLOW">Flow Control</A>
<A NAME="IDX521"></A>
<A NAME="IDX522"></A>
<A NAME="IDX523"></A>
<A NAME="IDX524"></A>
<A NAME="IDX525"></A>
<P><STRONG>Function</STRONG>
<P>
Retrieves an object from the cache. State is maintained between
executions of any macros containing GetGlobal.
<P><STRONG>Syntax</STRONG>
<P>
<TT><STRONG>object, link</STRONG></TT> = GetGlobal(<TT><STRONG>object,
reset</STRONG></TT>);
<P><STRONG>Inputs</STRONG>
<BR>
<TABLE BORDER>
<TR>
<TH ALIGN="LEFT" VALIGN="TOP" WIDTH="20%">Name
</TH><TH ALIGN="LEFT" VALIGN="TOP" WIDTH="20%">Type
</TH><TH ALIGN="LEFT" VALIGN="TOP" WIDTH="20%">Default
</TH><TH ALIGN="LEFT" VALIGN="TOP" WIDTH="40%">Description
</TH></TR><TR>
<TD ALIGN="LEFT" VALIGN="TOP" WIDTH="20%"><TT><STRONG>object</STRONG></TT>
</TD><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="20%">object
</TD><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="20%">none
</TD><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="40%">object to be output if nothing
has been set
</TD></TR><TR>
<TD ALIGN="LEFT" VALIGN="TOP" WIDTH="20%"><TT><STRONG>reset</STRONG></TT>
</TD><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="20%">flag
</TD><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="20%">0
</TD><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="40%">0: the object cached by SetGlobal
(if there is one) is passed to output
<BR>
1: <TT><STRONG>object</STRONG></TT> (not the cached object) is passed to
output.
</TD></TR></TABLE>
<P><STRONG>Outputs</STRONG>
<BR>
<TABLE BORDER>
<TR>
<TH ALIGN="LEFT" VALIGN="TOP" WIDTH="25%">Name
</TH><TH ALIGN="LEFT" VALIGN="TOP" WIDTH="25%">Type
</TH><TH ALIGN="LEFT" VALIGN="TOP" WIDTH="50%">Description
</TH></TR><TR>
<TD ALIGN="LEFT" VALIGN="TOP" WIDTH="25%"><TT><STRONG>object</STRONG></TT>
</TD><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="25%">object
</TD><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="50%">retrieved object
</TD></TR><TR>
<TD ALIGN="LEFT" VALIGN="TOP" WIDTH="25%"><TT><STRONG>link</STRONG></TT>
</TD><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="25%">string
</TD><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="50%">link to corresponding SetGlobal
module
</TD></TR></TABLE>
<P><STRONG>Functional Details</STRONG>
<P>
GetGlobal works with SetGlobal to place objects in and retrieve them
from the cache. GetGlobal is equivalent to (and replaces)
Get in previous versions
of Data Explorer. GetGlobal differs from GetLocal in that GetLocal and
SetLocal are used when the state maintained by the Get/Set pair should be
reset when a macro containing these modules is reexecuted. In contrast,
GetGlobal and SetGlobal will maintain state when the macro is reexecuted.
Note that for a single execution of a macro (for example, throughout
the execution of an entire loop), state is of course maintained by both
GetLocal and GetGlobal.
<TABLE CELLPADDING="3">
<TR VALIGN="TOP"><TD><P><B><TT><STRONG>object</STRONG></TT>
</B></TD><TD><P>specifies the object to be output by GetGlobal if nothing has
been placed
in the cache (e.g., as on the first execution of a visual program)
or if <TT><STRONG>reset</STRONG></TT> = 1.
</TD></TR><TR VALIGN="TOP"><TD><P><B><TT><STRONG>reset</STRONG></TT>
</B></TD><TD><P>causes the module to output <TT><STRONG>object</STRONG></TT>.
If this parameter is set to 0 (zero), GetGlobal retrieves the last object
placed in the cache by SetGlobal (if there is one).
Otherwise, the module passes <TT><STRONG>object</STRONG></TT> to the output.
</TD></TR></TABLE>
<P>
The <TT><STRONG>link</STRONG></TT> output is to be connected to the
<TT><STRONG>link</STRONG></TT> input of the corresponding SetGlobal
module.
GetGlobal must be used with SetGlobal,
rather than with SetLocal. SetGlobal must be executed on the
same machine as GetGlobal (i.e., it cannot be distributed to a
different machine).
<P><B>Notes: </B><OL>
<P><LI>The Reset interactor can be used to provide
<TT><STRONG>reset</STRONG></TT>. However,
if you are using GetGlobal and SetGlobal in
a loop, you should not use the Reset interactor to provide this
parameter, because the Reset interactor will output the reset value for
one execution, which is an <I>entire</I> execution of the loop. In
general, there are performance advantages to using GetLocal, rather than
GetGlobal with the First module supplying the <TT><STRONG>reset</STRONG></TT>
parameter. While the result will be the same, using GetLocal will
ensure that all previous results of the macro will be cached and ready
for reuse. If you use GetGlobal, only the last result of the macro is
cached.
<P><LI>Whenever there is a GetGlobal inside a macro, all outputs
of the macro will be stored in the cache with the cache attribute
"cache last". In other words, whenever any input to the macro
changes, the old results of the macro will be deleted
from the cache and the new results will be stored in the cache. There
is no way for the user to turn off caching for this macro. The results
are also locked in the cache, and cannot be flushed. This is because
GetGlobal maintains state for the macro that
may not be reproduced given the inputs to the macro. Inconsistent
behavior might result if results were not cached in this way.
<P><LI>Previously created visual programs which use Get and Set
will be run using GetGlobal and SetGlobal. You can explicitly
change your Gets and Sets to either GetGlobals and SetGlobals or
GetLocals and SetLocals using the Edit menu
(see <A HREF="usrgu045.htm#SPTSCOPE">Assign Get/Set Scope</A> in <I>IBM
Visualization Data Explorer User&#39;s Guide</I>).
There are performance advantages to using GetLocal and SetLocal whenever
you do not need to maintain state between executions of your macro which
uses Gets and Sets. A rule of thumb is that if you are using
the First module to
supply the reset parameter of Get, you should use GetLocal instead of
GetGlobal (and the use of First is then unnecessary).
</OL>
A detailed description of the behavior and use of the GetLocal,
GetGlobal, SetLocal, and SetGlobal modules can be found in
<A HREF="usrgu031.htm#HDRSTATES">4.6 , "Preserving Explicit State"</A> in <I>IBM
Visualization Data Explorer User&#39;s Guide</I>.
<P><STRONG>Example Visual Programs</STRONG>
<P>
<PRE>
SIMPLE/GetSet.net
</PRE>
<P><STRONG>See Also</STRONG>
<P>
&nbsp;<A HREF="refgu050.htm#HDRODONE">Done</A>,
&nbsp;<A HREF="refgu062.htm#HDROFIRST">First</A>,
&nbsp;<A HREF="refgu135.htm#HDRSETGLO">SetGlobal</A>,
&nbsp;<A HREF="refgu067.htm#HDRGETLOC">GetLocal</A>,
&nbsp;<A HREF="refgu136.htm#HDRSETLOC">SetLocal</A>,
&nbsp;<A HREF="refgu121.htm#HDRRESET">Reset</A>
<P>
&nbsp;<A HREF="usrgu026.htm#HDRXMOD">Chapter 4. "Data Explorer Execution
Model"</A> in <I>IBM Visualization Data Explorer User&#39;s Guide</I>.

		<P>
		<HR>
		<DIV align="center">
			<P><A href="../allguide.htm"><IMG src="../images/foot-fc.gif" width="94" height="18" border="0" alt="Full Contents"></A> <A href="../qikguide.htm"><IMG src="../images/foot-qs.gif" width="94" height="18" border="0" alt="QuickStart Guide"></A> <A href="../usrguide.htm"><IMG src="../images/foot-ug.gif" width="94" height="18" border="0" alt="User's Guide"></A> <A href="../refguide.htm"><IMG src="../images/foot-ur.gif" width="94" height="18" border="0" alt="User's Reference"></A></P>
		</DIV>
		<DIV align="center">
			<P><FONT size="-1">[ <A href="http://www.research.ibm.com/dx">OpenDX Home at IBM</A>&nbsp;|&nbsp;<A href="http://www.opendx.org/">OpenDX.org</A>&nbsp;] </FONT></P>
			<P></P>
		</DIV>
		<P></P>
	</BODY></HTML>
